using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace MoEngine
{
    public class CoreComponentDrawable : CoreComponent, IDrawable
    {
        #region IDrawable Members

        public virtual void Draw(GameTime appTime) { }

        protected int m_DrawOrder = 0;

        public int DrawOrder
        {
            get { return m_DrawOrder; }
            set
            {
                if (m_DrawOrder != value)
                {
                    m_DrawOrder = value;
                    EventHandler tempEvent = DrawOrderChanged;
                    if (tempEvent != null)
                    {
                        tempEvent(this, null);
                    }
                }
            }
        }

        public event EventHandler DrawOrderChanged;

        protected bool m_bVisible = true;

        public bool Visible
        {
            get { return m_bVisible; }

            set
            {
                if (m_bVisible != value)
                {
                    EventHandler tempEvent = VisibleChanged;
                    if (tempEvent != null)
                    {
                        tempEvent(this, null);
                    }
                }
            }
        }

        public event EventHandler VisibleChanged;

        #endregion
    }
}
